package c2.cross.server.controller;

import c2.cross.business.CrossBody;
import easy.java.spring.annotation.MyGetMapping;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

import static c2.advanced.server.controller.ControllerTool.R;

@Slf4j
@RequestMapping("/ladder/")
@Controller
public class LadderController extends CrossBaseController {

    @Resource
    private CrossBody body;

    // http://localhost:8585/ladder/saveStatus
    @MyGetMapping("saveStatus")
    @ResponseBody
    public Object saveStatus() {
        return R(()->body.ladder.saveStatus());
    }

    // http://localhost:8585/ladder/saveRankList
    @MyGetMapping("saveRankList")
    @ResponseBody
    public Object saveRankList() {
        return R(()->body.ladder.rank.saveRankList());
    }

}
